﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Net;
using HouseSecretary.Common.DEncrypt;

namespace HouseSecretary.Base
{
    /// <summary>
    /// 定义相关的全局变量
    /// </summary>
    public static class GlobalParams
    {
        /****************************
         * * **************************/
        /// <summary>
        /// 密码加密串值
        /// </summary>
        public const string GLOBAL_ENCRYPTVALUE = "ELINGSOFT_ABCDEFGHIJKLMNSTOPQ";
        /// <summary>
        /// 应用程序版本号
        /// </summary>
        public static string GLOBAL_VERSION;
        /// <summary>
        /// 超级管理员列表
        /// </summary>
        public static string[] GLOBAL_ADMINLIST = { "sa", "admin" };
        /// <summary>
        /// 当前登录ID
        /// </summary>
        public static string GLOBAL_LOGID = "";
        /// <summary>
        /// 当前登录者名称
        /// </summary>
        public static string GLOBAL_LOGFULLNAME = "";
        /// <summary>
        /// 应用程序名称
        /// </summary>
        public static string GLOBAL_PROGRAMNAME = "房秘书";
        /// <summary>
        /// 本机机器名
        /// </summary>
        public static string GLOBAL_COMPUTENAME = "";
        
        private static Common.HttpWebClient _httpWebClientObj = null;
        /// <summary>
        /// webApi交互连接类
        /// </summary>
        public static Common.HttpWebClient HttpWebClientObj
        {
            get
            {
                if (_httpWebClientObj == null)
                {
                    _httpWebClientObj = new Common.HttpWebClient();
                    _httpWebClientObj.RequestUrl = DESEncrypt.Decrypt(System.Configuration.ConfigurationManager.AppSettings["APIAddress"]); ;
                }
                
                return _httpWebClientObj;
            }
        }
    }
}
